import orange
import numpy
print("hello")
train_data = orange.ExampleTable("./test")

knn = orange.kNNLearner()
knn.k = 5
#knn.distanceConstructor = orange.ExamplesDistanceConstructor_Relief()
knn.distanceConstructor = orange.ExamplesDistanceConstructor_Euclidean()
knn = knn(train_data)

#Classify this next one
newOne = [[1, 2, 3, 4, 5], [5, 4, 3, 2, 1]]

#newData = orange.ExampleTable(train_data.domain, newOne)
newData = orange.ExampleTable(numpy.array(newOne))

c = knn(newData)
 
classattr = orange.EnumVariable("y", values = ["0", "1"])

card = [3, 3, 2, 3, 4, 2]
values = ["1", "2", "3", "4"]
attributes = [  orange.EnumVariable(chr(97+i),values = values[:card[i]])
              for i in range(6)]

print(classattr)
print(attributes)

domain = orange.Domain(attributes + [classattr])

data = orange.ExampleTable(domain)
 
print(train_data.domain)

print(c)

print(type(train_data))